package org.rednebula.framework.core.model;

import org.apache.commons.lang.StringUtils;
import org.rednebula.framework.core.utils.ExtendsStringUtils;

public abstract class SelfName implements IName {
	public abstract String getSelfSuffix();
	
	public String getSelfName() {
		String n=ExtendsStringUtils.toLowerCaseInitial( getClass().getSimpleName(),true);
		if(StringUtils.endsWithIgnoreCase(n, getSelfSuffix())){
			return StringUtils.substring(n, 0, n.length()-getSelfSuffix().length());
		}
		return n;
	}

}
